package com.fdb.efp.nls.service.impl;

import com.fdb.efp.nls.service.domain.YedGjjInvote;
import com.fdb.efp.nls.service.vo.YedGjjInvoteVO;
import com.fdb.basic.framework.core.base.FrameworkService;
import com.fdb.efp.nls.service.dao.YedGjjInvoteDao;
import com.fdb.efp.nls.service.facade.YedGjjInvoteService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Service Impl: 优e贷推送公积金信息表服务实现
 *
 * @author gcb
 * @date 2020-10-08
 */
@Service("yedGjjInvoteService")
public class YedGjjInvoteServiceImpl implements YedGjjInvoteService, FrameworkService {

    private static Logger logger = LoggerFactory.getLogger(YedGjjInvoteServiceImpl.class);

    @Autowired
    private YedGjjInvoteDao yedGjjInvoteDao;

    /**
     * 新增数据
     *
     * @param yedGjjInvoteVo
     * @return
     */
    @Override
    public int insert(YedGjjInvoteVO yedGjjInvoteVo) throws Exception {
        YedGjjInvote yedGjjInvote = new YedGjjInvote();
        beanCopy(yedGjjInvoteVo, yedGjjInvote);
        return yedGjjInvoteDao.insert(yedGjjInvote);
    }

    /**
     * 根据主键删除信息
     *
     * @param yedGjjInvoteVo
     * @return
     */
    @Override
    public int deleteByPk(YedGjjInvoteVO yedGjjInvoteVo) throws Exception {
        YedGjjInvote yedGjjInvote = new YedGjjInvote();
        beanCopy(yedGjjInvoteVo, yedGjjInvote);
        return yedGjjInvoteDao.deleteByPk(yedGjjInvote);
    }

    /**
     * 根据主键更新信息
     *
     * @param yedGjjInvoteVo
     * @return
     */
    @Override
    public int updateByPk(YedGjjInvoteVO yedGjjInvoteVo) throws Exception {
        YedGjjInvote yedGjjInvote = new YedGjjInvote();
        beanCopy(yedGjjInvoteVo, yedGjjInvote);
        return yedGjjInvoteDao.updateByPk(yedGjjInvote);
    }

    /**
     * 根据主键查询详情
     *
     * @param inYedGjjInvoteVo
     * @return
     */
    @Override
    public YedGjjInvoteVO queryByPk(YedGjjInvoteVO inYedGjjInvoteVo) throws Exception {
        YedGjjInvote queryYedGjjInvote = new YedGjjInvote();
        beanCopy(inYedGjjInvoteVo, queryYedGjjInvote);
        YedGjjInvote queryRslYedGjjInvote = yedGjjInvoteDao.queryByPk(queryYedGjjInvote);
        return beanCopy(queryRslYedGjjInvote, new YedGjjInvoteVO());
    }
}
